home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / ppp / dp-2.3 / h / if_ppp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-12  |  3.8 KB  |  106 lines

  1. /*
  2.  * if_ppp.h - Point-to-Point Protocol definitions.
  3.  *
  4.  * Copyright (c) 1989 Carnegie Mellon University.
  5.  * All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms are permitted
  8.  * provided that the above copyright notice and this paragraph are
  9.  * duplicated in all such forms and that any documentation,
  10.  * advertising materials, and other materials related to such
  11.  * distribution and use acknowledge that the software was developed
  12.  * by Carnegie Mellon University.  The name of the
  13.  * University may not be used to endorse or promote products derived
  14.  * from this software without specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  */
  19.  
  20. /* Portions Copyright (C) 1990 Brad K. Clements (streams support)
  21. */
  22. /*
  23.  * Copyright (c) 1992 Purdue University
  24.  * All rights reserved.
  25.  *
  26.  * Redistribution and use in source and binary forms are permitted
  27.  * provided that the above copyright notice and this paragraph are
  28.  * duplicated in all such forms and that any documentation,
  29.  * advertising materials, and other materials related to such
  30.  * distribution and use acknowledge that the software was developed
  31.  * by Purdue University.  The name of the University may not be used
  32.  * to endorse or promote products derived * from this software without
  33.  * specific prior written permission.
  34.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  35.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  36.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  37.  *
  38.  * Note: this copyright applies to portions of this software developed
  39.  * at Purdue beyond the software covered by the original copyright.
  40.  */
  41.  
  42. /*
  43.  * Standard PPP header.
  44.  */
  45. struct ppp_header {
  46.     u_char    ph_address;    /* Address Field */
  47.     u_char    ph_control;    /* Control Field */
  48.     u_short    ph_protocol;    /* Protocol Field */
  49. };
  50.  
  51. #define    PPP_ALLSTATIONS    0xff    /* All-Stations broadcast address */
  52. #define    PPP_UI        0x03    /* Unnumbered Information */
  53. #define    PPP_FLAG    0x7e    /* Flag Sequence */
  54. #define    PPP_ESCAPE    0x7d    /* Asynchronous Control Escape */
  55. #define    PPP_TRANS    0x20    /* Asynchronous transparency modifier */
  56.  
  57. /*
  58.  * Protocol types.
  59.  */
  60. #define PPP_IP        0x21    /* Internet Protocol */
  61. #define    PPP_XNS        0x25    /* Xerox NS */
  62. #define    PPP_VJC_COMP    0x2d    /* VJ compressed TCP */
  63. #define    PPP_VJC_UNCOMP    0x2f    /* VJ uncompressed TCP */
  64.  
  65. #define    PPP_LCP        0x8000    /* Upper bits for Link Control Protocol */
  66. #define    PPP_NCP        0xc000    /* Upper bits for Network Control Protocol */
  67.  
  68. /*
  69.  * Important FCS values.
  70.  */
  71. #define PPP_INITFCS    0xffff    /* Initial FCS value */
  72. #define PPP_GOODFCS    0xf0b8    /* Good final FCS value */
  73. #define PPP_FCS(fcs, c)    (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
  74.  
  75. #define    PPP_MTU        1500    /* Default MTU (size of Info field) */
  76. #define    PPP_HIWAT    1000    /* Don't start a new packet if HIWAT on queue */
  77. #define    CLISTRESERVE    1000    /* Can't let clists get too low */
  78.  
  79.  
  80. struct ppp_softc {
  81.     struct ifnet sc_if;    /* network-visible interface */
  82.     short    sc_flags;    /* see below */
  83.     short    sc_ilen;    /* length of input-packet-so-far */
  84.     struct    tty *sc_ttyp;    /* pointer to tty structure */
  85.     struct    mbuf *sc_m;    /* pointer to input mbuf chain */
  86.     struct    mbuf *sc_mc;    /* pointer to current input mbuf */
  87.     char    *sc_mp;        /* pointer to next char in input mbuf */
  88.     u_short    sc_fcs;        /* FCS so far */
  89.     u_long    sc_asyncmap;    /* async control character map */
  90.     struct    ifqueue sc_inq;    /* TTY side input queue */
  91. };
  92.  
  93. /* flags */
  94. #define    SC_ESCAPED    0x0001    /* saw a PPP_ESCAPE */
  95. #define    SC_FLUSH    0x0002    /* flush input until next PPP_FLAG */
  96.  
  97. #define t_sc T_LINEP
  98.  
  99. #ifdef    STREAMS
  100. /* defines for streams modules */
  101. #define    IF_INPUT_ERROR    0xe1
  102. #define    IF_OUTPUT_ERROR    0xe2
  103.  
  104. #define    ALLOCBSIZE    64        /* how big of a buffer block to allocate for each chunk of the input chain */
  105. #endif
  106.